<include file="Common/works/header" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/css.css" />
<style type="text/css"> 
.webuploader-pick { width: 148px; height:88px; z-index: -9999;}
</style> 
<div class="right" method="post" id="tab1" name="tab1">

	<div class="faservice">
		<div class="column">
			<div class="field">邮箱:</div>
			<input id="email"
				class="kt1 fl _email" />
		</div>
		<div class="column">
			<div class="field">token:</div>
			<input id="token"
				class="kt1 fl _token" autocomplete="on" />
			<div class="cls"></div>
		</div>

		<div class="cls"></div>
		<div class="column">
			<div class="field">请求地址:</div>
			<textarea id="api_url"
				class="textarea fl _api_url" maxlength="500"/></textarea>
			<div class="cls"></div>
		</div>

		<div class="column">
			<div class="field">返回数据:</div>
			<textarea class="nr lb _json_text" style=" background-color:#333; color:#fff991; font-weight:bolder; width:650px; height: 210px;resize: none;"></textarea>
			<div class="cls"></div>
		</div>

		<div class="column">
			<input type="button" class="confirm _test_confirm" data-id="list" autocomplete="on" maxlength="50"  value="模拟请求" style="margin-right: 10px" onClick="javascript:void(0)" /> 
			<div class="cls"></div>
		</div>
	</div>
</div>
</body>

<script src="__PUBLIC__/js/common.js" type="text/javascript"></script>
<script type="text/javascript">

$(function (){
	  $("._test_confirm").click(function(){
		 var email = $('._email').val();
		 var token = $('._token').val();
		 var api_url = $('._api_url').val();
		 
		  $.ajax({
			    url:'/Index/ajaxshttpproxytest.html',
			    type:'POST',
			    dataType:'json',
			    async:true,
			    data:{'email':email,'token':token,'api_url':api_url},
			    success:function (req){
			      if(req.status==200){
			        //json返回示例回写
			        if(req.data==''){
			        	$("._json_text").html('系统未返回数据');
			        }else{
				        var json_string = jsonFormat(req.data,false);
				        $("._json_text").html(json_string);
				        //console.log(json_string);
			        }
			      }else{
			        show_msg({msg:req.msg,type:'error',time:2000});
			      }
			      return false;
			    },
			    error:function (){
			      show_msg({msg:'系统异常',type:'error',time:1000});

			    }
			  });
	  })
	
});

</script>
</html>